<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>实现慕课网二级菜单栏显示与隐藏</title>
		<style>
			span {
				display: inline-block;
			}
			.nav {
				width: 1152px;
				height: 380px;
				background-color: blue;
				margin: 0 auto;
				position: relative;
			}
			.zuo{
				width: 255px;
				height: 380px;
				background-color: #39364d;
				color: white;
				float: left;
			}
			.zhong {
				width: 700px;
				height: 380px;
				background-color: #fff;
				/* display: block; */
				display: none;
				position: absolute;
				top: 0px;
				left: 255px;
			}
			img {
				width: 895px;
				height: 380px;
				float: left;
			}
		</style>
	</head>
	<body>
		<div class="nav">
			<span class="zuo">前端开发</span>
			<span class="zhong">我是要显示与隐藏的菜单</span>
			<img src="1.jpg" alt="">
		</div>
		<script>
			// 需要获取到 左侧菜单栏
			var zuo = document.querySelector('.zuo');
			// 鼠标进入到左侧菜单栏的时候，把中间的菜单栏给显示出来
			zuo.onmouseover = function(){
				zuo.parentNode.children[1].style.display = 'block';
			}
			
			// 鼠标出去的时候，把中间的菜单栏给隐藏起来
			zuo.onmouseout = function(){
				zuo.parentNode.children[1].style.display = 'none';
			}
		</script>
	</body>
</html>